#pragma once
#include "DXAMLCommon.h"
#include "CDOCollection.h"

class CItemsControl;


class CItemCollection :
	public CDOCollection
{

private: 
	CItemCollection(CCoreServices * pCore);
	virtual ~CItemCollection();
public: 
	static HRESULT Create(CDependencyObject * * ppObject, CREATEPARAMETERS * pCreate);
	virtual XUINT32 GetTypeIndex() const;
	virtual HRESULT Clear();
	virtual HRESULT SetOwner(CDependencyObject * pOwner, PFNOwnerDirtyFlag  * pfnOwnerDirtyFlag);
	virtual HRESULT Append(CDependencyObject * pObject, XUINT32 * pnIndex);
	virtual HRESULT Insert(XUINT32 nIndex, CDependencyObject * pObject);
	virtual void * RemoveAt(XUINT32 nIndex);
protected: 
	virtual XBOOL ShouldAssociateChildren(CDependencyObject * pChild);
	virtual void OnRemovingDependencyObject(CDependencyObject * pDO);
	virtual XBOOL ShouldParentBePublic();
	virtual XBOOL ShouldKeepPeerReference();
private: 
	HRESULT ClearLogicalParentForItems();
	CItemsControl * m_pItemsControl;


};
